package com.wg.msshopcar.entity.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "添加购物车参数")
public class AddShopCarDTO {
    @NotNull(message = "用户ID不能为空")
    @Schema(description = "用户ID")
    private Integer userId;

    @NotNull(message = "商品ID不能为空")
    @Schema(description = "商品ID")
    private Integer productId;

    @Schema(description = "商品规格信息")
    private String sku;

    @NotNull(message = "购买数量不能为空")
    @Min(value = 1, message = "购买数量必须大于0")
    @Schema(description = "购买数量")
    private Integer count;

    @NotNull(message = "商品价格不能为空")
    @Min(value = 0, message = "商品价格不能为负数")
    @Schema(description = "商品单价")
    private Double price;

    @NotNull(message = "店铺ID不能为空")
    @Schema(description = "商品所属店铺ID")
    private Integer shopId;

    @Schema(description = "添加时间")
    private String time;
}
